<style>.hide{display: none;}</style>
<div class="container" style="background:white;">
    <hr>
    <div class="row">
        <div class="col-xs-12">
            <div id="survey_info">
                <input type="text" vlue="" class="form-control" value="调查标题">
                <small>描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述</small>
            </div>
            <div>
                <hr>
                <?php $questions = $survey['questions'];?>
                <?php $result = array("questions"=>array());?>
                <?php foreach ($questions as $key => $value) { ?>
                <div class="form-group">
                    <label><?php echo $value['name']?></label>
                    <?php if($value['type']==1){ ?>
                    <?php foreach ($value['options'] as $k => $v) { ?>
                    <div class="radio">
                        <label>
                            <input type="radio" name="survey[questions][<?php echo $value['id']?>]" id="" value="<?php echo $v['id'];?>"  <?php if(array_key_exists($value['id'],$result['questions'])&&$v['id'] == $result['questions'][$value['id']]){echo "checked";}?>>
                            <?php echo $v['name'];?>
                        </label> 
                    </div>
                    <?php }?>
                    <?php }else if($value['type']==2){ ?>
                    <?php foreach ($value['options'] as $k => $v) { ?>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" name="survey[questions][<?php echo $value['id']?>]" id="" value="<?php echo $v['id'];?>" <?php if(array_key_exists($value['id'],$result['questions'])&&in_array($v['id'], $result['questions'][$value['id']])){echo "checked";}?>>
                            <?php echo $v['name'];?>
                        </label>
                    </div>
                    <?php }?>
                    <?php }else if($value['type']==3){?>
                    <textarea class="form-control" rows="3" name="survey[questions][<?php echo $value['id']?>]" ><?php if(array_key_exists($value['id'],$result['questions'])){echo $result['questions'][$value['id']];} ?></textarea>
                    <?php }?>
                </div>
                <hr>
                <?php } ?>

            </div>
        </div>
    </div>
</div>
<script src="/assets/static/js/module/survey_view.js"></script>